package cn.maxhou.mapper;

import cn.maxhou.entity.Supplier;
import cn.maxhou.service.Supplierervice;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

class SupplierMapperTest2 {

    @Test
    public void selectAll() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext2.xml");
        Supplierervice supplierervice = (Supplierervice) context.getBean("supplierervice");
        List<Supplier> suppliers = supplierervice.selectAll();
        for (Supplier supplier : suppliers) {
            System.out.println(supplier);
        }
    }

    @Test
    public void selectBySupName() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext2.xml");
        Supplierervice supplierervice = (Supplierervice) context.getBean("supplierervice");
        List<Supplier> suppliers = supplierervice.selectBySupName("巧克力");
        for (Supplier supplier : suppliers) {
            System.out.println(supplier);
        }
    }
}